<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>事件处理</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!--监听事件-->
    <div id="example-1">
        <button v-on:click="sums">增加1</button>
        <p>这个按钮被点击了{{counter}}次</p>
    </div>

    <script>

        new Vue({
            el:'#example-1',
            data:{
                counter:0
            },
            methods:{
                sums:function () {
                    this.counter+=1
                }
            }
        })
    </script>
</body>
</html>